DROP TABLE IF EXISTS jms_ods.yl_tms_branch_line;   
CREATE EXTERNAL TABLE jms_ods.yl_tms_branch_line(   
 ID bigint comment "主键",  --NUMBER(11)
 CODE string comment "支线编码",  --NVARCHAR2(30)
 NAME string comment "支线名称",  --NVARCHAR2(100)
 VEHICLELINE_TYPE bigint comment "车线类型(运营模式：自营/外租)",  --NUMBER(11)
 SHIFTS bigint comment "班次",  --NUMBER(11)
 LINE_TYPE bigint comment "线路类型 (1集货交件、2散货派件)",  --NUMBER(11)
 START_ID bigint comment "始发网点id",  --NUMBER(11)
 START_CODE string comment "始发网点编号",  --NVARCHAR2(20)
 START_NAME string comment "始发网点名称",  --NVARCHAR2(50)
 END_ID bigint comment "目的网点id",  --NUMBER(11)
 END_CODE string comment "目的网点编号",  --NVARCHAR2(20)
 END_NAME string comment "目的网点名称",  --NVARCHAR2(50)
 OPERATION_MODEL bigint comment "运行模式",  --NUMBER(11)
 EFFECTIVE_DATE timestamp comment "生效时间",  --DATE
 EXPIRATION_DATE timestamp comment "失效时间",  --DATE
 WORKING_DAY string comment "发出工作日",  --NVARCHAR2(20)
 VEHICLE_GROUPID bigint comment "规划车型组id",  --NUMBER(11)
 VEHICLE_TYPEGROUP string comment "规划车型",  --NVARCHAR2(50)
 CNT bigint comment "途径地数量",  --NUMBER(11)
 CAR_CNT bigint comment "车辆数",  --NUMBER(11)
 MILEAGE double comment "系统里程(km)",  --NUMBER
 TOTAL_RUNTIME bigint comment "总运行时间(min)",  --NUMBER(11)
 TOTAL_INTRANSITTIME bigint comment "总在途时间(min)",  --NUMBER(11)
 SPAN_DAYS bigint comment "跨越天数",  --NUMBER(11)
 STANDARD_SPEED double comment "标准时速(km/h)",  --NUMBER
 IS_ENABLE smallint comment "是否启用:1启用,0不启用",  --NUMBER(4)
 PLANNED_DEPARTURE_TIME string comment "规划发车时间",  --NVARCHAR2(5)
 PLANNED_ARRIVAL_TIME string comment "规划到车时间",  --NVARCHAR2(5)
 REMARK string comment "备注",  --NVARCHAR2(80)
 PRODUCT_TYPE string comment "产品类型",  --NVARCHAR2(20)
 CREATE_BY bigint comment "创建人id",  --NUMBER(11)
 CREATE_BY_NAME string comment "创建人姓名",  --NVARCHAR2(20)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_BY bigint comment "更新人id",  --NUMBER(11)
 UPDATE_BY_NAME string comment "更新人姓名",  --NVARCHAR2(50)
 UPDATE_TIME timestamp comment "更新时间",  --DATE
 IS_STOP smallint comment "是否经停：0：否，1：是",  --NUMBER(4)
 START_SIMPLE_NAME string comment "始发地简称",  --NVARCHAR2(50)
 END_SIMPLE_NAME string comment "目的地简称",  --NVARCHAR2(50)
 START_ATTRIBUTION_AREA string comment "始发所属代理区",  --NVARCHAR2(50)
 END_ATTRIBUTION_AREA string comment "目的所属代理区",  --NVARCHAR2(50)
 START_REGIONAL_DESC string comment "始发大区",  --NVARCHAR2(50)
 END_REGIONAL_DESC string comment "目的大区",  --NVARCHAR2(50)
 TEMPORARY_LINE tinyint comment "临时线路(1:是，2:否)",  --NUMBER(2)
 FRANCHISEE_START_CODE string comment "始发加盟商网点编码",  --NVARCHAR2(30)
 FRANCHISEE_START_NAME string comment "始发加盟商网点名称",  --NVARCHAR2(60)
 FRANCHISEE_END_CODE string comment "目的加盟商网点编码",  --NVARCHAR2(30)
 FRANCHISEE_END_NAME string comment "目的加盟商网点名称",  --NVARCHAR2(60)
 MAIN_ID bigint comment "主编码ID"  --NUMBER(11)
 )     
 COMMENT '运单变化记录表'    
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)') 
 STORED AS PARQUET   
 LOCATION '/dw/hive/jms_ods.db/external/yl_tms_branch_line'    
 TBLPROPERTIES (    
 'discover.partitions'='false',   
 'parquet.column.index.access'='true'   
 );     
     
MSCK REPAIR TABLE jms_ods.yl_tms_branch_line;   